package com.zhiyou.homework.service.impl;

import com.zhiyou.homework.dao.HomeworkDao;
import com.zhiyou.homework.pojo.Homework;
import com.zhiyou.homework.service.HomeworkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class HomeworkServiceImpl implements HomeworkService {

    @Autowired
    private HomeworkDao homeworkDao;
    /**
     * 发布作业
     * @param tid
     * @param content
     * @param url
     */
    @Override
    public void insertHomework(int tid, String content, String url) {
        Homework homework = new Homework();
        homework.setHreleasecontent(content);
        homework.setHreleaseimg(url);
        homework.setHreleasevideo(url);
        homework.setHtid(tid);
        homework.setHreleasetime(new Date());
        homeworkDao.insert(homework);
    }
}
